/*
 * Copyright(C) 2010 Luvina Software Company
 *
 * ExceptionInterceptor.java, Oct 29, 2010 ntmhuong
 */
package net.luvina.manageuser.util;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.aop.ThrowsAdvice;

/**
 * ExceptionInterceptor
 * @author ntmhuong
 *
 */
public class ExceptionInterceptor implements ThrowsAdvice {

    /**
     * afterThrowing
     * @param e Exception
     * @throws Throwable
     */
    public void afterThrowing(Exception e) throws Throwable {
        final Log logger = LogFactory.getLog(ExceptionInterceptor.class);

        logger.info(e.getClass().getName() + "例外が発生しました。 (" + e.getMessage() + ")");
        e.printStackTrace();
        throw e;
    }
}
